home *** CD-ROM | disk | FTP | other *** search
/ The Works of John Ruskin / The Works of John Ruskin - Installation CD.iso / WorksSetup.exe / TKNZTBLD.CPL < prev    next >
Text File  |  1996-05-02  |  28KB  |  860 lines

  1. ####################################################################
  2. #
  3. # File: tknztbld.def
  4. #
  5. # Personal Library Software, July, 1993
  6. # Tom Donaldson
  7. # Tokenizer definitional data for table driven tokenizer:
  8. #     CplTabledRomanceTokenizer.
  9. # The CplTabledRomanceTokenizer allows customization of tokenization by
  10. # editing rules that define the operation of the tokenizer.  Central
  11. # concept is "word continuation" rules, defining characters-kinds that 
  12. # CANNOT be split from each other.
  13. # History
  14. # -------
  15. #
  16. # 29jul1993    tomd    Performance improvements.  Got rid of unused
  17. #                       character classes.  Defined all non-token chars
  18. #                       to be "break" character class.  Ordered
  19. #                       user-defined character classes by expected 
  20. #                       frequency in text.
  21. #
  22. #                       Also added performance hints throughout.
  23. # 26aug93    tomd    No longer need to map all chars to char-classes.
  24. #             Unmapped ones will default to break-chars.
  25. #             No longer need to assign numeric values to character
  26. #             classes.  No longer need to assign names to predefined
  27. #             character classes (and cannot).
  28. #
  29. #            Canonizer map no longer has to contain all
  30. #            characters.
  31. #
  32. ####################################################################
  33.  
  34.  
  35.  
  36. ####################################################################
  37. # Installation
  38. # ============
  39. # Database.def File
  40. # -----------------
  41. # To use the CplTabledRomanceTokenizer, you need this line in the .def
  42. # file for the database:
  43. # TOKENIZER = CplTabledRomanceTokenizer
  44. # Tokenizer File
  45. # --------------
  46. # This file, tknztbld.def, is the rule file.  Note that the name of the
  47. # file CANNOT be changed, and the file MUST be in the "home directory"
  48. # of the database using the tokenizer, or the "system" directory for
  49. # the CPL installation.
  50. #
  51. ####################################################################
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. ####################################################################
  59. # Operational Overview
  60. # ====================
  61. # Database Open
  62. # -------------
  63. # When a database is opened, its .def file is read.  In the .def file,
  64. # a non-default tokenizer may be specified via a line of the form
  65. # TOKENIZER = aTokenizerName
  66. # If aTokenizerName is "CplTabledRomanceTokenizer", as soon as the
  67. # tokenizer is needed, it will try to read its definition file (i.e.,
  68. # this tknztbld.def file) from the same directory as the database's .def
  69. # file. 
  70. # If a problem arises during the load, tokenizer creation will fail.  In
  71. # this case, please do a "diff" between the file that failed to load and
  72. # the original copy.  Regretfully, few diagnostic error messages are
  73. # currently available to assist in determining why tokenizer definition
  74. # rules did not load.
  75. # During Tokenization
  76. # -------------------
  77. # As a buffer is scanned for words, each character is converted to a
  78. # "character class" via a Character Classification Map.  The character
  79. # classes are compared against tokenization rules, defined in this file.
  80. # If the rules explicitly state that the current character code may not
  81. # be separated from the preceding one, then the current character is
  82. # treated as part of a word, and the next character is classified and
  83. # tested.  This process continues until the scanner finds a character
  84. # whose classification is not specified in the rules as always being
  85. # kept with the character class of the just-preceding character.
  86. # Performance Hints
  87. # =================
  88. # The table driven tokenizer allows a great deal of flexibility in
  89. # scanning words.  It is possible to create a tokenizer definition that
  90. # will scan complex patterns as tokens, or not, depending upon the
  91. # immediate context of the characters being scanned.  However, this
  92. # flexibility comes at a price: performance.  
  93. # In general, the simpler and fewer the character classes and rules the
  94. # faster tokenization will be.  That is, the closer the rules come to
  95. # generating tokens that would pass the simple isalnum() test, the
  96. # faster tokenization will be.  The further your needs depart from this
  97. # simplicity, the longer it will take to index files.
  98. ####################################################################
  99.  
  100.  
  101.  
  102.  
  103.  
  104. ###################################################################
  105. # Required File Layout
  106. # ====================
  107. # This tokenizer definition file, tknztbld.def, must contain the
  108. # following sections in this order:
  109. #     Section 1: Character Class Definitions
  110. #     Section 2: Character Classification Map
  111. #     Section 3: Word Continuation Rules
  112. #     Section 4: Canonization Map
  113. # Section 1, the "Character Class Definitions", gives meaningful names
  114. # to "kinds" of characters.  These class names are used in defining
  115. # what kinds of characters make up words.
  116. # Section 2, the "Character Classification Map", assigns a character
  117. # class to each character in the character set used by documents.
  118. # Section 3, the "Word Continuation Rules", uses the character class
  119. # names defined in the Character Class Definitions to specify what
  120. # groupings of characters may not be separated from each other during
  121. # tokenization.
  122. # Section 4, the "Canonization Map", specifies translations of
  123. # characters from their raw input form to their final "canonical"
  124. # indexed form.
  125. # The detailed structure of each section of the tokenizer definition is
  126. # covered in comments accompanying the sections, below.
  127. # The lines in this file that are preceded by the pound character, '#',
  128. # are comment lines (obviously).  Comments may only appear on a line by
  129. # themselves, but comment lines may appear anywhere in the file.
  130. # Likewise, blank lines may appear anywhere in the file.
  131. ####################################################################
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138. ####################################################################
  139. #
  140. # Section 1: Character Class Definitions
  141. #
  142. ####################################################################
  143. # The Character Class Definitions give names to the types of
  144. # characters that can take part in words, and that delimit words.  These
  145. # names will be used in Section 2, the Character Classification Map, to
  146. # assign character classes to individual characters.
  147. #  
  148. # You may define up to 250 character classes, although fewer than 10
  149. # will most likely be enough.  Every character than can possibly ever
  150. # appear in the data to be tokenized MUST be assigned one of the defined
  151. # classes.  The mapping is done via a character-class map, which appears
  152. # at the end of this file.
  153. #
  154. # Predefined Special Values
  155. # =========================
  156. # There are four predefined values that are special to the tokenizer:
  157. #     Invalid - NO character should EVER be of this class.
  158. #     EndRule - This is a character class that is used in this
  159. #               definition file to mark the end of your character
  160. #               classification names.  It must be the last character
  161. #               class name listed in the table below, and can only be
  162. #               the last one listed.
  163. #     Break --- Characters of the "Break" class can NEVER be part of a
  164. #               token.  It is always valid for the tokenizer to
  165. #               word-break the data stream either before or after a Break
  166. #               character.
  167. #     EndBuff - Characters of the EndBuff class will be treated as a
  168. #               "null" terminating character when scanning data for
  169. #               tokens.  The ASCII NUL character is an EndBuff character
  170. #               by default, and you will not normally map other
  171. #               characters to this class.
  172. # Only predefined Character Class names, or Character Class names that
  173. # are defined in this Character Class Definition section may be used
  174. # anywhere else in the definition.  Definitions are case sensitive.
  175. #
  176. # Performance Hints
  177. # =================
  178. # 1) Use The "Break" Class As Much As Possible.  The Break class is a
  179. # special character class.  Minimal testing is done on characters
  180. # classified as Break.  This is because it is ALWAYS valid to separate a
  181. # Break character from any other character.  Any characters that will
  182. # NEVER be part of a token should be classified as Break.
  183. #  
  184. # 2) Define Class Names By Frequency.  When creating user-defined character
  185. # classes, list the classes that will be assigned to the largest numbers
  186. # of characters in the data first.  For example, you would expect most
  187. # data in a text file to classified as "letter" characters; you should
  188. # define your "letter" class name first.
  189. # 3) Define As Few Classes As Possible.  Fewer classes means less
  190. # testing.  Less testing means faster tokenization.
  191.  
  192.  
  193.  
  194.  
  195.  
  196. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  197. #  Default Character Class Definitions: Values and Names
  198. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  199. #
  200. # Name
  201. # ----
  202.   Letter
  203.   Number
  204.   Underscore
  205.   Z_Special
  206. # The EndRule character class must always be the last class name listed,
  207. # and must only appear at the end of your character class definitions.
  208. # If it is not at the end of char class defs, an error occurs as soon as
  209. # the loader hits a non-blank, non-comment line that is not a character
  210. # class definition.
  211.   EndRule
  212.  
  213. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  214.  
  215. ####################################################################
  216. #
  217. # Section 2: Character Classification Map
  218. #
  219. ####################################################################
  220. #
  221. # Maps characters to word-continuation character classes.
  222. # The Character Classification Map associates a character code with a
  223. # character class.  The character classes must have been defined in the
  224. # Character Class Definition in Section 1.  Only character class names
  225. # that have been defined in the Character Class Definition (Section 1,
  226. # above) may appear in this Character Classification Map (Section 2) or
  227. # in the Word Continuation Rules (Section 3, below).
  228. # Default Mapping
  229. # ===============
  230. # You only need to provide character classification for the characters
  231. # that you want to appear in tokens.
  232. # Any characters that you do NOT map will be classified in this way:
  233. #     - ASCII NUL is mapped as the end-of-buffer marker.
  234. #     - All other characters are mapped as break characters.
  235. # End Of Map Marker
  236. # =================
  237. # As for the previous table, there is a special value for this Character
  238. # Classification Map that marks its end.  The special value is -1.  The
  239. # decimal character code -1 will cause the Character Classification Map
  240. # loader to stop reading.
  241. #
  242. # Performance Hints
  243. # =================
  244. # Leave as many characters classified as "break" characters as possible.
  245. # Classify as many characters to the same class as possible.
  246. # The following sample table uses Dollar and Bang classes for tokenizing
  247. # specialized technical documentation.  If you don't need the Dollar and
  248. # Bang characters in indexable terms, change their mapping to Break, and
  249. # remove all references to Dollar and Bang in the Character Class
  250. # Definitions and the Word Continuation Rules.  Your database will index
  251. # faster.
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  259. #
  260. #  Character Classification Map
  261. #
  262. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  263. #
  264. # -------    -----        -----------------------
  265. # Decimal    Class
  266. #  Value    Name        Comment
  267. # -------    -----        -----------------------
  268. # Special characters:
  269.  
  270. # Digits:
  271.    48        Letter        # Char '0'
  272.    49        Letter        # Char '1'
  273.    50        Letter        # Char '2'
  274.    51        Letter        # Char '3'
  275.    52        Letter        # Char '4'
  276.    53        Letter        # Char '5'
  277.    54        Letter        # Char '6'
  278.    55        Letter        # Char '7'
  279.    56        Letter        # Char '8'
  280.    57        Letter        # Char '9'
  281.  
  282. # Upper case letters:
  283.    65        Letter        # Char 'A'
  284.    66        Letter        # Char 'B'
  285.    67        Letter        # Char 'C'
  286.    68        Letter        # Char 'D'
  287.    69        Letter        # Char 'E'
  288.    70        Letter        # Char 'F'
  289.    71        Letter        # Char 'G'
  290.    72        Letter        # Char 'H'
  291.    73        Letter        # Char 'I'
  292.    74        Letter        # Char 'J'
  293.    75        Letter        # Char 'K'
  294.    76        Letter        # Char 'L'
  295.    77        Letter        # Char 'M'
  296.    78        Letter        # Char 'N'
  297.    79        Letter        # Char 'O'
  298.    80        Letter        # Char 'P'
  299.    81        Letter        # Char 'Q'
  300.    82        Letter        # Char 'R'
  301.    83        Letter        # Char 'S'
  302.    84        Letter        # Char 'T'
  303.    85        Letter        # Char 'U'
  304.    86        Letter        # Char 'V'
  305.    87        Letter        # Char 'W'
  306.    88        Letter        # Char 'X'
  307.    89        Letter        # Char 'Y'
  308.    90        Letter        # Char 'Z'
  309.  
  310.  
  311. # Lower case letters:
  312.    97        Letter        # Char 'a'
  313.    98        Letter        # Char 'b'
  314.    99        Letter        # Char 'c'
  315.    100        Letter        # Char 'd'
  316.    101        Letter        # Char 'e'
  317.    102        Letter        # Char 'f'
  318.    103        Letter        # Char 'g'
  319.    104        Letter        # Char 'h'
  320.    105        Letter        # Char 'i'
  321.    106        Letter        # Char 'j'
  322.    107        Letter        # Char 'k'
  323.    108        Letter        # Char 'l'
  324.    109        Letter        # Char 'm'
  325.    110        Letter        # Char 'n'
  326.    111        Letter        # Char 'o'
  327.    112        Letter        # Char 'p'
  328.    113        Letter        # Char 'q'
  329.    114        Letter        # Char 'r'
  330.    115        Letter        # Char 's'
  331.    116        Letter        # Char 't'
  332.    117        Letter        # Char 'u'
  333.    118        Letter        # Char 'v'
  334.    119        Letter        # Char 'w'
  335.    120        Letter        # Char 'x'
  336.    121        Letter        # Char 'y'
  337.    122        Letter        # Char 'z'
  338.    156      Letter      # Char 'z'
  339.    161      Letter      # Char 'z'
  340.    192      Letter      # Char 'z'
  341.    193      Letter      # Char 'z'
  342.    194      Letter      # Char 'z'
  343.    195      Letter      # Char 'z'
  344.    196      Letter      # Char 'z'
  345.    197      Letter      # Char 'z'
  346.    198      Letter      # Char 'z'
  347.    199      Letter      # Char 'z'
  348.    200      Letter      # Char 'z'
  349.    201      Letter      # Char 'z'
  350.    202      Letter      # Char 'z'
  351.    203      Letter      # Char 'z'
  352.    204      Letter      # Char 'z'
  353.    205      Letter      # Char 'z'
  354.    206      Letter      # Char 'z'
  355.    207      Letter      # Char 'z'
  356.    208      Letter      # Char 'z'
  357.    209      Letter      # Char 'z'
  358.    210      Letter      # Char 'z'
  359.    211      Letter      # Char 'z'
  360.    212      Letter      # Char 'z'
  361.    213      Letter      # Char 'z'
  362.    214      Letter      # Char 'z'
  363.    215      Letter      # Char 'z'
  364.    216      Letter      # Char 'z'
  365.    217      Letter      # Char 'z'
  366.    218      Letter      # Char 'z'
  367.    219      Letter      # Char 'z'
  368.    220      Letter      # Char 'z'
  369.    221      Letter      # Char 'z'
  370.    222      Letter      # Char 'z'
  371.    223      Letter      # Char 'z'
  372.    224      Letter      # Char 'z'
  373.    225      Letter      # Char 'z'
  374.    226      Letter      # Char 'z'
  375.    227      Letter      # Char 'z'
  376.    228      Letter      # Char 'z'
  377.    229      Letter      # Char 'z'
  378.    230      Letter      # Char 'z'
  379.    231      Letter      # Char 'z'
  380.    232      Letter      # Char 'z'
  381.    233      Letter      # Char 'z'
  382.    234      Letter      # Char 'z'
  383.    235      Letter      # Char 'z'
  384.    236      Letter      # Char 'z'
  385.    237      Letter      # Char 'z'
  386.    238      Letter      # Char 'z'
  387.    239      Letter      # Char 'z'
  388.    240      Letter      # Char 'z'
  389.    241      Letter      # Char 'z'
  390.    242      Letter      # Char 'z'
  391.    243      Letter      # Char 'z'
  392.    244      Letter      # Char 'z'
  393.    245      Letter      # Char 'z'
  394.    246      Letter      # Char 'z'
  395.    248      Letter      # Char 'z'
  396.    249      Letter      # Char 'z'
  397.    250      Letter      # Char 'z'
  398.    251      Letter      # Char 'z'
  399.    252      Letter      # Char 'z'
  400.    253      Letter      # Char 'z'
  401.    254      Letter      # Char 'z'
  402.    255      Letter      # Char 'z'
  403.  
  404.    90        Z_Special        # Char 'Z'
  405.  
  406.    95        Underscore    # Char '_'
  407. # ---        -----        -----------------------
  408.    -1        EndOfDefs    # Not loaded.  Just marks end of map definition.
  409. # ---        -----        -----------------------
  410.  
  411.  
  412.  
  413.    
  414.  
  415.  
  416.  
  417.  
  418. ####################################################################
  419. #
  420. # Section 3: Word Continuation Rules
  421. #
  422. ####################################################################
  423. # The word continuation rules specify which sequences of characters
  424. # CANNOT be separated from each other in breaking a stream of data into
  425. # words. 
  426. # Each rule consists of character class names separated by spaces or
  427. # tabs.  A rule says that characters of the specified classes may not be
  428. # split.  For example, the rule:
  429. #   Letter Letter
  430. # says that when two data characters are of class Letter, and occur side
  431. # by side, the data characters may not be separated.
  432. # Similarly, the rule:
  433. #   Letter Number
  434. # says that a character that classifies as a Letter may not be separated
  435. # from a following character that classifies as a Number.
  436. #
  437. # Example 1:
  438. # How does the tokenizer decide whether a character is a Letter or a
  439. # Number?  That association is formed by the Character Classification
  440. # Map, in Section 2.  Using the Character Classification Map in this
  441. # file, and the two "Letter Letter" and "Letter Number" rules just
  442. # presented, the following input text:
  443. #   "A-1   B 2   C3   4D   5 E   6-F   GH   IJ7LMNOP"
  444. # Will tokenize as:
  445. #   "A" "B" "C3" "D" "E" "F" "GH" "IJ7" "LMNOP"
  446. # Because: A Letter may not be separated from a following Letter, and a
  447. # Letter may not be separated from a following Number.  However, a
  448. # Number may be separated from a following Letter, and all other
  449. # characters are considered as delimiters.  Obviously, we need more
  450. # rules.  A more complete sample set follows.
  451.  
  452.  
  453.  
  454.  
  455.  
  456. # Character Class Names, and '*'
  457. # ------------------------------
  458. # All character class names in each rule MUST have been defined in the
  459. # Character Class Definitions in Section 1, above, with the exception of
  460. # one special "name": the '*' character.  The '*' character means that
  461. # characters of the preceding class may occur one or more times in a
  462. # sequence.
  463. # Note that in previous rule we said that no two letters could be
  464. # separated.  We did this with the rule:
  465. #     Letter Letter
  466. # But what if a single letter, such as the "A" in "Section A", occurs by
  467. # itself?  The "Letter Letter" rule does NOT say that "A" is a valid
  468. # token.  The following two rules together DO say that a single letter,
  469. # or any number of letters in a row, must be treated as a token:
  470. #     Letter
  471. #     Letter Letter
  472. # However, we can reduce this to a single rule using the special
  473. # character class name "*":
  474. #     Letter *
  475. # Example 2: "Unusual" Characters In Tokens
  476. # This rule:
  477. #   Dollar * Letter
  478. # Says that a stream of Dollar characters may not be broken if they are
  479. # followed by a Letter.  This rule will cause these strings to be
  480. # treated as words:
  481. #   "$$SysDevice"
  482. #   "$Fr$ed"
  483. #   "$x8"
  484. # But the same "Dollar * Letter" rule will not accept these strings:
  485. #   "SysDevice$$$"  -- Token will be "SysDevice", "$$$" is junk.
  486. #   "Fr$ed"         -- Tokens will be "Fr" and "$ed".
  487. #   "x$8"           -- Token will be "x", the "$" and "8" will be
  488. #                      discarded.
  489. # Example 3:  More Complex Rules
  490. # Using the example rules to this point, the string:
  491. #   "tomd@pls.com"
  492. # Will be tokenized as:
  493. #   "tomd" "pls" "com"
  494. # To cause tomd@pls.com to be accepted as a token, we can define this
  495. # rule:
  496. #   Letter * AtSign Letter * Dot Letter *
  497. # Or define these equivalent rules:
  498. #   Letter *
  499. #   Letter AtSign
  500. #   AtSign Letter
  501. #   Letter Dot Letter
  502. # Implicit Linking of Rules
  503. # -------------------------
  504. # It is important to note that rules functionally link to each other.
  505. # For example, we used these two rules in the previous example:
  506. #   Letter AtSign
  507. #   AtSign Letter
  508. # That is, a Letter may not be separated from a following AtSign, and an
  509. # AtSign may not be separated from a following Letter, which
  510. # functionally has the same effect as:
  511. #   Letter AtSign Letter
  512. # Thus, the last character class on a rule can match-up with the same
  513. # character class at the head of another rule (or the same rule) to
  514. # match longer strings.  In fact, the tokenizer does this, internally,
  515. # to create the longest tokens it can from an input stream.
  516. # EndRule: End of Definitions Marker
  517. # ----------------------------------
  518. # The last "rule" in the list of rules MUST consist of solely the
  519. # EndRule character class (i.e., the rule with Value 1).  It tells the
  520. # Word Continuation Rule loader that it is finished.  If the EndRule is
  521. # missing, the Word Continuation Rule loader will try to eat any
  522. # following data as continuation rules, and will fail.
  523. #
  524. # Default Word Continuation Rules
  525. # -------------------------------
  526. # The following, short, rule set will create tokens consisting of
  527. # Numbers, Letters, and Dollars freely intermixed.  It will NOT create
  528. # tokens containing ONLY Dollars; the rules state that for a Dollar to
  529. # be part of a token, the Dollar must be followed by a Letter.  The
  530. # rules also allow a single bang character, "!", at the beginning of a
  531. # token.  Note that these rules are intended for a particular type of
  532. # technical documentation, and will probably not exactly fit your needs.
  533. #
  534. # Examples Using Default Word Continuation Rules
  535. # ----------------------------------------------
  536. #
  537. # Example 1':
  538. #
  539. # The string from Example 1:
  540. #   "A-1   B 2   C3   4D   5 E   6-F   GH   IJ7LMNOP"
  541. # Previously tokenized as:
  542. #   "A" "B" "C3" "D" "E" "F" "GH" "IJ7" "LMNOP"
  543. # With the default rules, below, tokenizes as:
  544. #   "A" "1" "B" "2" "C3" "4D" "5" "E" "6" "F" "GH" "IJ7MNOP"
  545. # Example 2':
  546. #
  547. # The strings from Example 2:
  548. #   "$$SysDevice"
  549. #   "$Fr$ed"
  550. #   "$x8"
  551. # Previously tokenized as:
  552. #   "SysDevice" "Fr" "$ed" "x"
  553. # With the default rules, below, tokenize as:
  554. #   "$$SysDevice" "$Fr$ed" "$x8"
  555. # Example 3':
  556. #
  557. # The string from Example 3:
  558. #   "tomd@pls.com"
  559. # Will still be tokenized as (lacking the AtSign and Dot rules):
  560. #   "tomd" "pls" "com"
  561. # Performance Hints
  562. # =================
  563. # 1) Keep Rules As Simple As Possible.  The simpler the rule, the faster
  564. # the word-continuation tests.  If a rule uses few character classes,
  565. # and contains few items, it is "simple."  If a rule uses more than two
  566. # character classes, or uses two or more classes in different
  567. # permutations, the rule is "complex."
  568. # 2) Define As Few Rules As Possible.  The fewer rules there are to
  569. # check, the faster will be tokenization.
  570. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  571. #
  572. # Word Continuation Rules
  573. #
  574. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - 
  575. # I apologize if this explanation has been overly long, especially given
  576. # the brevity of the following rules.  This documentation is partially
  577. # for me (Tom Donaldson), and partially for anyone using the tokenizer.
  578. # If I jot it down now, there is a better chance I will "remember" it
  579. # all later!
  580.   Z_Special Underscore Letter *
  581.   Z_Special Underscore Z_Special * Letter *
  582.   Z_Special Underscore Letter * Z_Special *
  583.   Letter *
  584.   Number *
  585. #
  586. # Rule End MUST be the last rule in the continuation rules.
  587. # It must NOT occur as part of any other rule.
  588. #
  589. EndRule
  590. #
  591. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601. ####################################################################
  602. #
  603. # Section 4: Canonization Map
  604. #
  605. ####################################################################
  606. # After the tokenizer returns a "word", based on the rules defined in
  607. # the first three sections of this file, it must be put into a
  608. # regularized, "canonical", form to make searches easier and faster.  In
  609. # fact, canonizing tokens can also drastically reduce the size of the
  610. # database's dictionary.
  611. # A common form of canonization is to convert all lower case letters to
  612. # upper case, and use the upper cased terms in the index and during
  613. # searches.  This allows, for example, the word "NeXT" to match the
  614. # words "next", "NEXT", "nExt", etc.  Note that this also means that
  615. # only one version of "next" is stored in the index, rather than all
  616. # permutations on the case of the letters that might exist in the
  617. # database.
  618. # The canonization map allows you to determine what character by
  619. # character transforms are performed during canonization.  The default
  620. # canonization supplied in the following table maps all lower case
  621. # characters to upper case.  All other values are mapped to themselves;
  622. # that is, all other values are unchanged after canonization.
  623. # For example, in some databases you might want to convert the "A WITH
  624. # TILDE" to a plain "A".  You can do this by specifying that the "A
  625. # WITH TILDE" character, with character code 195, should be canonized
  626. # to the character "A", with character code 65:
  627. #   195    65    # Canonize A-tilde as A
  628. # Default Values
  629. # ==============
  630. # You do not have to define a mapping for all characters.  The default
  631. # for all characters is to map to itself.  Thus, your canonization
  632. # mapping table need only contain characters which you want to have
  633. # translated after tokenization.
  634. # CRITICAL
  635. # ========
  636. # As for the previous table, there is a special value for this
  637. # Canonization Map that marks its end.  The special value is -1.  The
  638. # decimal character code -1 will cause the Canonization Map loader to
  639. # stop reading.
  640. #  
  641. #
  642. # Performance Hints
  643. # =================
  644. # None.
  645. #
  646. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  647. #
  648. # Default Canonization Map
  649. #
  650. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  651. #
  652. # -------    -------        -----------
  653. #  Input    Output
  654. # Decimal    Decimal
  655. #  Char         Char
  656. #  Value     Value        Comment
  657. # -------    -------        -----------
  658. #
  659. # Map the characters a-z to the "canonical" characters A-Z.  That is,
  660. # all letters will be upper cased.
  661.    97        65        # Char 'a' canonizes to 'A'
  662.    98        66        # Char 'b' canonizes to 'B'
  663.    99        67        # Char 'c' canonizes to 'C'
  664.   100        68        # Char 'd' canonizes to 'D'
  665.   101        69        # Char 'e' canonizes to 'E'
  666.   102        70        # Char 'f' canonizes to 'F'
  667.   103        71        # Char 'g' canonizes to 'G'
  668.   104        72        # Char 'h' canonizes to 'H'
  669.   105        73        # Char 'i' canonizes to 'I'
  670.   106        74        # Char 'j' canonizes to 'J'
  671.   107        75        # Char 'k' canonizes to 'K'
  672.   108        76        # Char 'l' canonizes to 'L'
  673.   109        77        # Char 'm' canonizes to 'M'
  674.   110        78        # Char 'n' canonizes to 'N'
  675.   111        79        # Char 'o' canonizes to 'O'
  676.   112        80        # Char 'p' canonizes to 'P'
  677.   113        81        # Char 'q' canonizes to 'Q'
  678.   114        82        # Char 'r' canonizes to 'R'
  679.   115        83        # Char 's' canonizes to 'S'
  680.   116        84        # Char 't' canonizes to 'T'
  681.   117        85        # Char 'u' canonizes to 'U'
  682.   118        86        # Char 'v' canonizes to 'V'
  683.   119        87        # Char 'w' canonizes to 'W'
  684.   120        88        # Char 'x' canonizes to 'X'
  685.   121        89        # Char 'y' canonizes to 'Y'
  686.   122        90        # Char 'z' canonizes to 'Z'
  687.  
  688. # ---        -----        -----------------------
  689.    -1        -1        # Not loaded.  Just marks end of map definition.
  690. # ---        -----        -----------------------
  691.  
  692. ####################################################################
  693. #
  694. # End Of File: tknztbld.def
  695. #
  696. ####################################################################
  697.  
  698.